package com.example.smart_campus.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.smart_campus.pojo.dto.students.StudentsTable;
import com.example.smart_campus.pojo.dto.teachers.TeachersTable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.relational.core.mapping.Table;

import java.io.Serializable;

/**
 * <p>
 * 教师表，存储教师的基本信息
 * </p>
 *
 * @author liyv
 * @since 2024-10-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("teachers")
public class Teachers implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 教师ID，主键
     */
    @TableId(value = "teacher_id", type = IdType.AUTO)
    private Integer teacherId;

    /**
     * 教师工号
     */
    private String teacherNo;


    /**
     * 教师姓名
     */
    private String name;
    /**
     * 教师密码
     */

    private String password;
    /**
     * 教师电话
     */
    private String phone;

    /**
     * 教授课程
     */
    private String courses;


    /**
     * 教师联系方式
     */
    private String contactInfo;

    /**
     * 教师专业
     */
    private String major;





    @Override
    public String toString() {
        return "Teachers{" +
        "teacherId=" + teacherId +
        ", name=" + name +
        ", contactInfo=" + contactInfo +

        "}";
    }

    public Teachers(TeachersTable table) {
        this.teacherNo = table.getTeacherNo();
        this.name = table.getName();
        this.phone = table.getPhone();
        this.major = table.getMajor();

        this.password = "123456" ;
    }
}
